package com.gitee.loyo.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 车位状态
 */
@Getter
@AllArgsConstructor
public enum ParkStatus {
    UNKNOWN(0, "未知"), IDLE(10, "空闲"), USING(50, "占用");

    private int code;
    private String text;

    public static ParkStatus valueOf(int code){
        switch (code){
            case 0: return UNKNOWN;
            case 10: return IDLE;
            case 50: return USING;
        }
        throw new UnsupportedOperationException("unknown code: " + code);
    }
}
